﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Master/Admin.master" AutoEventWireup="true" CodeFile="UserList.aspx.cs" Inherits="SY.WebSite.Web.View.UserList" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <title>列表管理 - 员工管理 - 后台管理系统 - <%= Settings.Title %></title>
    <link href="<%= Settings.StaticFileDomain %>/Scripts/util/jquery-pagination/lib/jquery_pagination/pagination.css" rel="stylesheet" type="text/css" />    
    <link href="<%= Settings.StaticFileDomain %>/Scripts/util/JqModal/JqPopU.css" rel="stylesheet" type="text/css" />
    <%--<link href="<%= Settings.StaticFileDomain %>/Scripts/util/ui.uapselector/skin/default/main.css" rel="stylesheet" type="text/css" />--%>
    <%--<script src="<%= Settings.StaticFileDomain %>/Scripts/util/My97DatePicker/WdatePicker.js" type="text/javascript"></script>--%>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/template/trimpath-template.js" type="text/javascript"></script>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/jquery-pagination/lib/jquery_pagination/jquery.pagination.js" type="text/javascript"></script>
    <%--<script src="<%= Settings.StaticFileDomain %>/Scripts/util/ui.uapselector/jquery.ui.uapselector.js" type="text/javascript"></script>--%>
    <script src="<%= Settings.StaticFileDomain %>/Scripts/util/JqModal/JqPopU.js" type="text/javascript"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="body" Runat="Server">
    <div>
	    <h1>
		    <small>员工管理</small>
	    </h1>
    </div>
    <form class="form-search">
        <fieldset>
	        工号/姓名：<input class="input-small" id="userName" type="text" placeholder="工号或姓名"/>&nbsp;&nbsp;
            所属部门：<input class="input-medium" id="deptName" type="text" placeholder="所属部门"/> 
            职位：<input class="input-small" id="jobName" type="text" placeholder="职位"/> 
            在职状态：
            <select id="status" style="width:80px">
                <option value="100">全部</option>
                <option value="0">在职</option>
                <option value="1">离职</option>
            </select>
            性别：
            <select id="gender" style="width:80px">
                <option value="100">全部</option>
                <option value="1">男</option>
                <option value="2">女</option>
                <option value="0">未知</option>
            </select>
            管理员：
            <select id="usertype" style="width:80px">
                <option value="200">全部</option>
                <option value="100">是</option>
                <option value="0">否</option>
            </select>
            <button type="button" class="btn" onclick="page.getUserList(0)">查询</button>
        </fieldset>
    </form>
    <div id="result"></div>
    <div id="pagination"></div>
    <textarea name="userList" id="userList" style="display:none;"> 
    <table class="table table-hover table-striped">
		<thead>
			<tr>
				<th>工号</th><th>姓名</th><th>性别</th><th>所属部门</th><th>职位</th><th>手机</th>
                <th>邮箱</th><%--<th>最近登录时间</th>--%><th>状态</th><th>管理员</th><th>&nbsp;</th>
            </tr>
        </thead>
		<tbody>
            {for p in list}
			<tr>
				<td>@{p.JobNumber}</td>
                <td>@{p.UserName}</td>
                <td>{if p.Gender == 1}男{elseif p.Gender == 2}女{elseif}<span class="muted">未知</span>{/if}</td>
                <td>@{p.DeptName}</td>
                <td>@{p.JobName}</td>
                <td>{if p.Phone !=0 }@{p.Phone}{/if}</td>
                <td>@{p.Email}</td>
                <%--<td>@{p.LastLoginTime}</td>--%>
                <td>{if p.Status == 0}在职{else}离职{/if}</td>
                <td>{if p.UserType == 100}是{else}否{/if}</td>
                <td>
                    <div class="btn-group">
                        <a class="btn" href="#">操作</a>
                        <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"><span class="caret"></span></a>
                        <ul class="dropdown-menu">
                        <li><a href="javascript:void(0)" onclick="page.edit(@{p.UserId})">编辑</a></li>
                        <li><a href="javascript:void(0)" onclick="page.resetPassword('@{p.UserName}', @{p.JobNumber}, @{p.UserId})">重置密码</a></li>                        
                        <li class="divider"></li>
                        {if p.Status == 0}
                        <li><a href="javascript:void(0)" onclick="page.setStatus(1,@{p.UserId})">设为离职</a></li>
                        {else}
                        <li><a href="javascript:void(0)" onclick="page.setStatus(0,@{p.UserId})">设为在职</a></li>
                        {/if}
                        <li class="divider"></li>
                        {if p.UserType == 100}
                        <li><a href="javascript:void(0)" onclick="page.setUserType(0,@{p.UserId})">取消管理员</a></li>
                        {else}
                        <li><a href="javascript:void(0)" onclick="page.setUserType(100,@{p.UserId})">设为管理员</a></li>
                        {/if}
                        </ul>
                    </div>
                </td>
			</tr>
            {forelse}
            <tr><td colspan="9">暂无相关数据</td></tr>
            {/for}
		</tbody>
	</table>
    </textarea>

    <textarea name="detail" id="detail" style="display:none;"> 
        <div class="row">
            <form class="form-horizontal">
            <div style="float:left">
                <div class="control-group">
                    <label class="control-label">员工</label>
                    <div class="controls">
                        <label class="control-label" style="width:240px; text-align:left;">@{UserName}<small>(@{JobNumber})</small></label>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="udeptName">所属部门</label>
                    <div class="controls">
                        <input id="udeptName" placeholder="所属部门" type="text" value="@{DeptName}" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="uphone">手机</label>
                    <div class="controls">
                        <input id="uphone" placeholder="手机" type="text" value="@{Phone}" />
                    </div>
                </div>
            </div>
            <div style="float:left">
                <div class="control-group">
                    <label class="control-label" for="ugender">性别</label>
                    <div class="controls">
                        <select id="ugender">
                            <option value="0">请选择</option>
                            <option value="1">男</option>
                            <option value="2">女</option>
                        </select>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="ujobName">职位</label>
                    <div class="controls">
                        <input id="ujobName" placeholder="职位" type="text" value="@{JobName}" />
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label" for="uemail">邮箱</label>
                    <div class="controls">
                        <input id="uemail" placeholder="邮箱" type="text" value="@{Email}" />
                    </div>
                </div>
            </div>
            <div style="clear:both" class="control-group">
                <label class="control-label"></label>
                <div class="controls">
                    <button type="button" class="btn btn-info" id="btnEdit">修改</button>
                </div>
            </div>
            </form>
        </div>
    </textarea>

    <script src="<%= Settings.StaticFileDomain %>/Scripts/page/admin/index.js" type="text/javascript"></script>
</asp:Content>